package com.eascs.workflow.email.dubbo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.eascs.notify.constant.ModelResult;
import com.eascs.notify.wechat.WechatMsgType;
import com.eascs.notify.wechat.WechatNotifier;
import com.eascs.notify.wechat.WechatNotifyRequest;
import com.eascs.notify.wechat.WechatNotifyResponse;
import com.eascs.site.controller.BaseRestController;
@RestController
public class TestController extends BaseRestController {
	
	@Reference
	WechatNotifier wechatNotifier;
	@RequestMapping(value = "/sendWechatMessage")
	public void  sendWechatMessage(){
		
		WechatNotifyRequest re=new WechatNotifyRequest();
		
		String corpId= "wx12891e910218beed" ;
		String secret= "cBX8fe2tifObwDA3OOp8cm5pcHqsdWZOKYNkDd-uCPk2gMAyiZB-FFaGkmh1ma_a" ;
		re.setRequestId("1");
		re.setCorpId(corpId);
		re.setSecret(secret);
		re.setTouser("SZ8494");
		re.setToparty("信息技术部");
		re.setAgentid(0);
		re.setContent("我们都是好孩子");
		 re.setMsgType(WechatMsgType.REQ_MESSAGE_TYPE_TEXT);
		 ModelResult<WechatNotifyResponse> model=wechatNotifier.notify(re);
		 System.out.println(model.getErrMsg());
	}
	
}